import request from '@/utils/request'

export function totalHighRiskUser(){
    return request({
        url: '/result/result/totalHighRiskUser',
        method: 'get'
    })
}

/**
 * 获取患者历史评估结果
 * @param patientId
 * @param counselorId
 * @returns {*}
 */
export function getPatineHistoryList(patientId, counselorId){
    return request({
        url: `/result/result/getPatineHistoryList/${patientId}/${counselorId}`,
        method: 'get'
    })
}

/**
 * 添加评估结果
 * @param data
 * @returns {*}
 */
export function addAssessmentResult(data, patientId, counselorId) {
    return request({
        url: `/result/result/addAssessmentResult/${patientId}/${counselorId}`,
        method: 'post',
        data: data
    })
}

/**
 * 获取患者列表
 * @param query
 * @returns {*}
 */
export function listPatient(query) {
    return request({
        url: '/result/result/getPatientList',
        method: 'post',
        params: query
    })
}

// 查询咨询结果列表
export function listResult(query) {
    return request({
        url: '/result/result/list',
        method: 'get',
        params: query
    })
}

// 查询咨询结果详细
export function getResult(resultId) {
    return request({
        url: '/result/result/' + resultId,
        method: 'get'
    })
}

// 新增咨询结果
export function addResult(data) {
    return request({
        url: '/result/result',
        method: 'post',
        data: data
    })
}

// 修改咨询结果
export function updateResult(data) {
    return request({
        url: '/result/result',
        method: 'put',
        data: data
    })
}

// 删除咨询结果
export function delResult(resultId) {
    return request({
        url: '/result/result/' + resultId,
        method: 'delete'
    })
}
